#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QLabel>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    //目的昵称的套接字序号
    int desnumber=9999;
    ~MainWindow();

private slots:
    void on_startlisten_clicked();

    void on_sentmsg_clicked();

protected:
    //定义容器存储密码和账号
    QList <QString> username;
    QList <QString> passward;

    QList <QTcpSocket*> mytcp;

    QList <QString> linkuser; //源昵称
    QList <int> number; //记录源昵称的套接字序号
    QList <QString> desuser; //记录目的昵称
    QList <QString> chatname; //记录聊天室名称
    QList <int> now;
    QVector<QVector<int>> chatnumber; //定义二维数组来记录当前聊天室在线人数的套接字序号

private:
    Ui::MainWindow *ui;
    QTcpServer *m_s;
    QTcpSocket *m_tcp;
    QLabel *m_status;
};

#endif // MAINWINDOW_H
